import schedule
import time
from core.updates import UpdateFetcher

def scheduled_task():
    print("Running scheduled task...")
    fetcher = UpdateFetcher()
    updates = fetcher.fetch_updates("https://gitee.com/sample/repo")
    print("Updates:", updates)

def start_scheduler():
    schedule.every().day.at("09:00").do(scheduled_task)
    print("Scheduler started!")
    while True:
        schedule.run_pending()
        time.sleep(1)
